package org.darcy.framework.exception;

/**
 * 自定义异常：统一业务异常类型，方便全局处理
 */
public class BusinessException extends RuntimeException {

	private static final long serialVersionUID = 1L;
	private String key;
	private Object[] values;

	public BusinessException() {
		super();
	}

	public BusinessException(String message, Throwable throwable) {
		super(message, throwable);
	}

	/**
	 * 业务异常
	 */
	public BusinessException(String message) {
		super(message);
	}

	public BusinessException(Throwable throwable) {
		super(throwable);
	}

	public BusinessException(String key, String message) {
		super(message);
		this.key = key;
	}

	public BusinessException(String key, Object value, String message) {
		super(message);
		this.key = key;
		this.values = new Object[] { value };
	}

	public BusinessException(String key, Object[] values, String message) {
		super(message);
		this.key = key;
		this.values = values;
	}

	public String getKey() {
		return key;
	}

	public Object[] getValues() {
		return values;
	}
}
